package com.sharp.schedule.dao.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.*;
import lombok.Data;

/**
 * Title: SaSchedule
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2022/6/28 11:18
 */

/**
 * 定时任务表
 */
@ApiModel(value = "com-sharp-schedule-dao-entity-SaSchedule")
@Data
@Table(name = "sa_schedule")
public class SaSchedule {
    @Id
    @Column(name = "id")
    @GeneratedValue(generator = "JDBC")
    @ApiModelProperty(value = "")
    private Integer id;

    /**
     * 定时任务名
     */
    @Column(name = "job_name")
    @ApiModelProperty(value = "定时任务名")
    private String jobName;

    /**
     * 0:单次,1:cron,2:结束间隔周期,3:开始间隔周期
     */
    @Column(name = "`type`")
    @ApiModelProperty(value = "0:单次,1:cron,2:结束间隔周期,3:开始间隔周期")
    private String type;

    /**
     * 定时任务表达式(type = 1)
     */
    @Column(name = "cron")
    @ApiModelProperty(value = "定时任务表达式(type = 1)")
    private String cron;

    /**
     * 启动时间
     */
    @Column(name = "start_time")
    @ApiModelProperty(value = "启动时间")
    private Date startTime;

    /**
     * 周期间隔时间(type=2 or 3)
     */
    @Column(name = "period")
    @ApiModelProperty(value = "周期间隔时间(type=2 or 3)")
    private Integer period;

    /**
     * 临时任务持久化
     */
    @Column(name = "`temporary`")
    @ApiModelProperty(value = "临时任务持久化")
    private String temporary;

    /**
     * 服务名
     */
    @Column(name = "service")
    @ApiModelProperty(value = "服务名")
    private String service;

    /**
     * 方法名
     */
    @Column(name = "`function`")
    @ApiModelProperty(value = "方法名")
    private String function;

    /**
     * 参数(JSON)
     */
    @Column(name = "`parameter`")
    @ApiModelProperty(value = "参数(JSON)")
    private String parameter;

    /**
     * 重试次数
     */
    @Column(name = "retry")
    @ApiModelProperty(value = "重试次数")
    private Integer retry;

    /**
     * 状态
     */
    @Column(name = "`status`")
    @ApiModelProperty(value = "状态")
    private String status;

    /**
     * 备注
     */
    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    /**
     * 添加时间
     */
    @Column(name = "create_at")
    @ApiModelProperty(value = "添加时间")
    private Date createAt;

    /**
     * 有效性
     */
    @Column(name = "`valid`")
    @ApiModelProperty(value = "有效性")
    private String valid;
}